<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>管理员权限编辑</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__LAYUI__/layui/css/layui.css" media="all">
</head>
<body>
<form class="layui-form" action="" method="post" lay-filter="admin-form">
    <div class="layui-form-item">
        <div class="layui-input-inline">
            <input type="hidden" name="id" value="{$adminAuth.id}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-inline">
            <input type="text" name="title" value="{$adminAuth.title}" lay-verify="required" placeholder="请输入名称"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">模块名</label>
        <div class="layui-input-inline">
            <input type="text" name="module" value="{$adminAuth.module}" lay-verify="required" placeholder="请输入模块名"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">URL</label>
        <div class="layui-input-inline">
            <input type="text" name="name" value="{$adminAuth.name}" lay-verify="required" placeholder="请输入URL"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline" style="width: 80%">
            <label class="layui-form-label">父级权限</label>
            <div class="layui-input-block">
                <select name="pid" lay-filter="pid">
                    <option value="0">顶级</option>
                    {volist name="adminAuthTree" id="vo"}
                    <option value="{$vo.id}" {if $vo.id == $adminAuth.pid}selected{/if}>{$vo.title_show}</option>
                    {/volist}
                </select>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">选择图标</label>
        <div class="layui-input-block">
            <input type="text" name="icon" id="iconPicker" lay-filter="iconPicker" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">说明</label>
        <div class="layui-input-inline">
            <input type="text" name="remark" value="{$adminAuth.remark}" placeholder="请输入说明"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-inline">
            <input type="text" name="sort" value="{$adminAuth.sort}" placeholder="请输入排序编号"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否菜单</label>
        <div class="layui-input-block">
            <input name="is_menu"
                   {if isset($adminAuth.is_menu) && $adminAuth.is_menu== 1}checked{elseif !isset($adminAuth.is_menu)}checked{else/}{/if}
            lay-skin="switch" lay-text="是|否" type="checkbox">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否显示</label>
        <div class="layui-input-block">
            <input name="is_show"
                   {if isset($adminAuth.is_show) && $adminAuth.is_show== 1}checked{elseif !isset($adminAuth.is_show)}checked{else/}{/if}
            lay-skin="switch" lay-text="显示|隐藏" type="checkbox">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="checkbox" name="status"
                   {if isset($adminAuth.status) && $adminAuth.status== 1}checked{elseif !isset($adminAuth.status)}checked{else/}{/if}
            lay-skin="switch" lay-text="启用|禁用">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
    </div>
</form>

<script src="__LAYUI__/layui/layui.js"></script>
<script>
    layui.config({
        base: '__LAYUI__/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'iconPicker'], function () {
        var form = layui.form,
            iconPicker = layui.iconPicker;

        iconPicker.render({
            // 选择器，推荐使用input
            elem: '#iconPicker',
            // 数据类型：fontClass/unicode，推荐使用fontClass
            type: 'fontClass',
            // 是否开启搜索：true/false
            search: true,
            // 是否开启分页
            page: true,
            // 每页显示数量，默认12
            limit: 36
        });
        iconPicker.checkIcon('iconPicker', "{$adminAuth.icon}");
    })
</script>
</body>
</html>